import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JPanel;


public class Panel extends JPanel {

	private int anchoImagen, altoImagen;
	private Image image;
	
	public Panel(String rutaImagen, int ancho, int alto) {
		super();
		image = new ImageIcon(getClass().getResource(rutaImagen)).getImage();
		this.anchoImagen = ancho;
		this.altoImagen = alto;
		this.setLayout(null);
		
	}	
	
	@Override
	public void paintComponent(Graphics g) {	
		g.drawImage(image, 0, 0, this.anchoImagen, this.altoImagen, null);
		setOpaque(false);
		super.paintComponent(g);
	}
	
}
